#include<bits/stdc++.h>
using namespace std;
#define int long long

const int mx = 1e6 + 5;

struct Edg{
    int u, v, w, nxt;
}edg[mx];

int CNT;
int head[mx];

void add_edg(int u, int v, int w = 1){
    edg[++CNT] = (Edg){u, v, w, head[u]};
    head[u] = CNT;
}

int n;
int a[mx];

namespace pts100{
    int ans, pre, pre1 = 1;

    void solve(){
        sort(a + 1, a + n + 1);
        for(int i = 2; i <= n; i++){
            if(a[i] == a[i - 1]) pre1++;
            else pre += pre1, pre1 = 1;
            if(pre) ans++, pre--;
        }
        cout << n - ans << '\n';
    }
}

void solve(){
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i];
    pts100::solve();
}

signed main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int T = 1; //cin >> T;
    while(T--) solve();
}